/* 
 * File:   resource.h
 * Author: bjorn
 *
 * Created on September 3, 2007, 8:46 PM
 */

#ifndef _RESOURCE_H
#define	_RESOURCE_H

#include <stdbool.h>
#include "rope.h"
#include "script.h"
#include "image.h"

#ifndef ERUTA_RESOURCE_PATH
    #define ERUTA_RESOURCE_PATH "./share/config.lua:/usr/local/share/eruta/config.lua"
#endif

#ifndef ERUTA_PATH_SEP_STR 
	#define ERUTA_PATH_SEP_STR  ":"
#endif
	
#ifndef ERUTA_PATH_SEP_CHAR
	#define ERUTA_PATH_SEP_CHAR ':'
#endif	



struct Resource {
	Script		_script;
	Rope		_path;
	Ropelist    _directories;
	Rope        _config;
	Resource(); 
	~Resource (); 
	Image 			loadimage_c(const char * imagename);
	Image			loadimage_display_c(const char * imagename); 
	Fontpointer 	loadfont_c(const char * imagename, int size = 16);
	bool 	scan();
	bool 	run_script(const Rope filename);
	
}; 



extern bool file_exists(const char *filename);



#endif	/* _RESOURCE_H */

